<?php
require('./lib/init.php');
//检测是否登录,若没有.调回登录页面
if (!acc()) {
	header('Location:login.php');
	exit();
}
//计算分页代码
$sql = "select count(*) from art";
$sum = mGetOne($sql);//获取总文章数
$cnt = 16; //每页显示3篇文章
$curr = isset($_GET['page']) ? $_GET['page'] : 1 ;//当前页码数,从地址栏获取
$page = cPager($sum,$cnt,$curr);


//试用左连接将catname查询出来
$sql = "select art.*,cat.catname from art left join cat on art.cat_id = cat.cat_id order by art_id limit ".($curr-1)*$cnt.','.$cnt;
$art = mGetAll($sql);

include(ROOT.'/view/admin/artlist.html');

 ?>